// antd 按需加载
import { Toast } from '@ant-design/react-native';

import store from '../../../store/store.js'
import * as ActionTypes from '../../../constants/constants.js'
import { isUser, isWxUser, path, saveData, loadData, removeData } from '../../../util/utils.js'
import request from '../../../api/request.js'

export async function category(options) {
    const { dispatch } = this.props
    const res = await request.HomeController.category(options)
    if (res.error) {
        dispatch({
            type: ActionTypes.categoryError,
            data: res
        })
        return
    }
    
    let newCategory=[]
    res.data.data.map((item) => {
     if (item.mold < 3) {
       newCategory.push(item) 
     }
    })
    
    dispatch({
        type: ActionTypes.category,
        data: newCategory
    })
}
